<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ page import="cn.pzhu.jspdb.dao.UserDao" %>
<%@ page import="cn.pzhu.jspdb.bean.User" %>
<%
String id=request.getParameter("id");
User u=new UserDao().getUserById(Integer.parseInt(id));
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		if(u!=null){
	%>
	<form method="post" action="update.jsp">
		<input type="hidden" name="id" value="<%=u.getId() %>">
		LoginName<input type="text" name="loginName" 
		value="<%=u.getLoginName()%>"><br/>
		Password<input type="text" name="password" 
		value="<%=u.getPassword() %>"><br/>
		<input type="submit" value="Update User">
	</form>
	<%}else{%>
		<h3 style="color:red">出错了，没有找到ID=<%=id %>的记录</h3>
	<%} %>
	
</body>
</html>